<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="common/header.jsp"%>



<div class="col-md-12 col-sm-12 col-xs-12">
  <div class="x_panel">
    <div class="x_title">
      <h2>Form Design <small>different form elements</small></h2>
      <ul class="nav navbar-right panel_toolbox">
        <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
        </li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="#">Settings 1</a>
            </li>
            <li><a href="#">Settings 2</a>
            </li>
          </ul>
        </li>
        <li><a class="close-link"><i class="fa fa-close"></i></a>
        </li>
      </ul>
      <div class="clearfix"></div>
    </div>
    <div class="x_content">
      <br>
      <form action="${pageContext.request.contextPath }/devApp/appInfoAdd" method="post" enctype="multipart/form-data" id="demo-form2" data-parsley-validate="" class="form-horizontal form-label-left" novalidate="">

        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">软件名称 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
            <input id="first-name" name="softwarename" placeholder="请输入软件名称" required="required" class="form-control col-md-7 col-xs-12" type="text">
          </div>
        </div>
        
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">APK名称 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
          	<!-- 校验APK名称的唯一性 -->
            <input onblur="checkAPKName(this)" id="first-name" name="apkname" placeholder="请输入apk名称" required="required" class="form-control col-md-7 col-xs-12" type="text">
            <span id="apkNameInfo"></span>
          </div>
        </div>
        
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">支持ROM <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
            <input id="first-name" name="supportrom" placeholder="请输入支持的ROM" required="required" class="form-control col-md-7 col-xs-12" type="text">
          </div>
        </div>
        
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">界面语言 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
            <input id="first-name" name="interfacelanguage" placeholder="请输入界面语言" required="required" class="form-control col-md-7 col-xs-12" type="text">
          </div>
        </div>
        
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">软件大小 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
            <input id="first-name" name="softwaresize" placeholder="请输入软件大小" required="required" class="form-control col-md-7 col-xs-12" type="number">
          </div>
        </div>
        
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">下载次数 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
            <input id="first-name" name="downloads" placeholder="请输入下载次数" required="required" class="form-control col-md-7 col-xs-12" type="number">
          </div>
        </div>
        
        <div class="form-group">
			<label class="control-label col-md-3 col-sm-3 col-xs-12"
				for="first-name">所属平台 <span class="required">*</span>
			</label>
			<div class="col-md-6 col-sm-6 col-xs-12">
				<select class="form-control col-md-7 col-xs-12" name="flatformid">
					<option value="">--请选择--</option>
					<c:forEach items="${appFlatFormList }" var="appFlatForm">
						<option  value="${appFlatForm.valueid}">${appFlatForm.valuename}</option>
					</c:forEach>
				</select>
			</div>
		</div>
        
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">一级分类 <span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<select onchange="findCategoryLevelTwo(this)" name="categorylevel1"
						class="form-control col-md-7 col-xs-12">
						<option value="">--请选择--</option>
						<c:forEach items="${appCategoryLevelOneList }" var="appCategoryLevelOne">
							<option  value="${appCategoryLevelOne.id}">${appCategoryLevelOne.categoryname}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">二级分类 <span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<select onchange="findCategoryLevelThree(this)" id="levelTwoSelect" class="form-control col-md-7 col-xs-12"
						name="categorylevel2">
						<option value="">--请选择--</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">三级分类 <span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<select name="categorylevel3" class="form-control col-md-7 col-xs-12" id="levelThreeSelect"								name="categorylevel3">
						<option value="">--请选择--</option>
					</select>
				</div>
			</div>
        
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">APP状态 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
            <input  class="form-control col-md-7 col-xs-12" value="待审核" type="text" readonly="readonly">
            <input type="hidden" name="status" value="1">
          </div>
        </div>
        
         <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">APP简介 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
          	<textarea class="form-control col-md-7 col-xs-12" name="appinfo" placeholder="输入APP简介.."></textarea>
          </div>
        </div>
        
        <div class="form-group">
          <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">LOGO图片 <span class="required">*</span>
          </label>
          <div class="col-md-6 col-sm-6 col-xs-12">
          	<input class="form-control col-md-7 col-xs-12" type="file" name="picFile" id="photo">
          	<div id="click" style="display: none;width:200px;height:200px;"></div>
	<script>
		document.getElementById('photo').addEventListener('change',function(e){
			
			var files = this.files;
			var img = new Image();
			var reader = new FileReader();
			reader.readAsDataURL(files[0]);
			reader.onload = function(e){
				var mb = (e.total/1024)/1024;
				if(mb>= 2){
					alert('文件大小大于2M');
					return;
				}
				img.src = this.result;
				img.style.width = "80%";
				document.getElementById('click').width="100px";
				document.getElementById('click').height="100px";
				document.getElementById('click').innerHTML = '';
				document.getElementById('click').appendChild(img);
				document.getElementById('click').style.display="block";
			}
		});
	</script>
          	<span style="color:red">${fileInfo}</span>
          </div>
        </div>
        
        
        
        
        
        
        <div class="ln_solid"></div>
        <div class="form-group">
          <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
            <button type="submit" class="btn btn-primary">添加APP基础信息</button>
          </div>
        </div>

      </form>
    </div>
  </div>
</div>







<%@include file="common/footer.jsp"%>